(function() {

startTest("www2010");

prop_count = 20;

obj_count = 100;

function createDataSet() {
    var root = {};

    for (var x=0; x < obj_count; x+=1) {
        var obj = {};
        for (var y=0; y < prop_count; y+=1) {
            obj[y.toString()] = y;
        }
        root[x.toString()] = obj;
    }

    return root;
}


test("register and persist -- control", function() {
    persist.localReset();

    realStorage.setObject('tester', createDataSet());
});


test("register and persist -- setter", function() {
    persist.localReset();

    persist.root.tester = true;

    persist.localSync();  // Create property to use

    persist.root.tester = createDataSet();
});


test("register, persist, add accessors -- stabilization", function() {
    persist.localReset();

    persist.root.tester = createDataSet();

    persist.localSync();
});


prep(function() {
    persist.localReset();

    persist.root.tester = createDataSet();

    persist.localSync();
});

test("check for new properties -- stabilization", function() {
    persist.localSync();
});


prep(function() {
    persist.localReset();
    window.level1 = {level2: {tester: 42}};
});

test("accessor overhead -- control", function() {
    return level1.level2.tester;
});

prep(function() {
    persist.localReset();
    persist.root.tester = 42;
    persist.localSync();
    return persist.root.tester;
});

test("accessor overhead -- accessor", function() {
    return persist.root.tester;
});


test("gc overhead -- live/everything", function() {
    persist.localReset();
    persist.root.tester = createDataSet();
    persist.localSync();
    persist.root.tester = undefined;
    persist.gc();

});

test("gc overhead -- cold/everything", function() {
    persist.localReset();
    persist.root.tester = createDataSet();
    persist.localSync();
    persist.localReload();
    persist.root.tester = undefined;
    persist.gc();
});

test("gc overhead -- live/nothing", function() {
    persist.localReset();
    persist.root.tester = createDataSet();
    persist.localSync();
    persist.gc();

});

test("gc overhead -- cold/nothing", function() {
    persist.localReset();
    persist.root.tester = createDataSet();
    persist.localSync();
    persist.localReload();
    persist.gc();
});


endTest();

 })();
